package com.modifiertech.lineage.event;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.player.PlayerEvent;

/**玩家升级事件
 *
 */
public class PlayerLevelUpEvent extends PlayerEvent {
    private long oldLevel;
    private long newLevel;
    private long leftExp;

    public PlayerLevelUpEvent(EntityPlayer player,long oldLevel
            ,long newLevel,long leftExp) {
        super(player);
        this.oldLevel=oldLevel;
        this.newLevel=newLevel;
        this.leftExp=leftExp;
    }

    public long getOldLevel() {
        return oldLevel;
    }

    public void setOldLevel(long oldLevel) {
        this.oldLevel = oldLevel;
    }

    public long getNewLevel() {
        return newLevel;
    }

    public void setNewLevel(long newLevel) {
        this.newLevel = newLevel;
    }

    public long getLeftExp() {
        return leftExp;
    }

    public void setLeftExp(long leftExp) {
        this.leftExp = leftExp;
    }

    /**订阅该Pre事件的处理器不能做与Post处理器一样的数据内容
     * 否则可能产生脏数据,在设计上,pre 仅能做类似通知的工作
     *
     */
    public static class Pre extends PlayerLevelUpEvent{

        public Pre(EntityPlayer player, long oldLevel, long newLevel, long leftExp) {
            super(player, oldLevel, newLevel, leftExp);
        }
    }

    /**订阅该Post事件的处理器可以做较为复杂的数据，但是注意，核心的数据更新仍然应该在主线程做
     *
     */
    public static class Post extends PlayerLevelUpEvent{

        public Post(EntityPlayer player, long oldLevel, long newLevel, long leftExp) {
            super(player, oldLevel, newLevel, leftExp);
        }
    }

    public static class PostErr extends PlayerLevelUpEvent{

        public PostErr(EntityPlayer player, long oldLevel, long newLevel, long leftExp) {
            super(player, oldLevel, newLevel, leftExp);
        }
    }






}
